<template>	
	<view class="newsbox">
		<view class="pic">
			<image :src="item.picurl" mode="aspectFill"></image>
		</view>
		<view class="text">
			<view class="title">
				<view class="con">
					{{item.title}}
				</view>				
			</view>
			<view class="info" v-if="!item.looktime">
				<view class="font">{{item.author}}</view>
				<view class="font">{{item.hits}}浏览</view>
			</view>
			<view class="info" v-else>
				<view class="font">浏览时间：{{item.looktime}}</view>
			</view>
		</view>
		
	</view>	
</template>

<script>	
	export default {
		name:"newsbox",
		props:{
			item:{
				type:Object,
				default(){
					return {
						title:"学习文章",
						author:"一叶知秋",
						hits:666,
						picurl:"../../static/images/view.jpeg",
						looktime:null
					}
				}
			}
		},
		data() {
			return {
				
			};
		}
	}
</script>

<style lang="scss">
.newsbox{
	display: flex;
	justify-content: space-between;
	.pic{
		width: 230rpx;
		height: 160rpx;
		image{
			width: 100%;
			height: 100%;
		}
	}
	.text{
		flex:1;
		padding-left:20rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		.title{
			.con{
				font-size: 36rpx;
				color:#333;
				display: -webkit-box;
				overflow: hidden;
				text-overflow: ellipsis;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
			}			
		}
		.info{
			font-size: 26rpx;
			color:#999;
			display: flex;
			.font{
				padding-right: 20rpx;
			}
		}
	}
}
</style>